package org.ecshop.controllers;

import java.util.List;

import javax.annotation.Resource;

import org.ecshop.models.Goods;

import will.icecoffe.core.DataAccessException;
import will.icecoffe.core.SimpleDataAccessService;

import com.opensymphony.xwork2.ModelDriven;



public class CollectGoodsController implements ModelDriven<Object> {

	private List<Goods> list;
	
	private int key;
	
	public int getKey() {
		return key;
	}

	public void setKey(int key) {
		this.key = key;
	}
	
	
	@Resource(name="DAS")
	private SimpleDataAccessService<Goods> das;

	public String index() throws DataAccessException {
		this.list = das.find("hql", "findCollectedGoodsByUserId", key);
		return null;
	}

	@Override
	public Object getModel() {
		return list;
	}

}
